package org.come.Jpanel;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.plaf.basic.BasicTreeUI;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreePath;

import org.come.Frame.TestpackJframe;
import org.come.Frame.ZhuFrame;
import org.come.bean.Skill;
import org.come.entity.Goodstable;
import org.come.model.petExchange;
import org.come.until.*;

import com.tool.btn.FormsOnOffBtn;
import com.tool.btn.SummoningCompoundBtn;
import com.tool.image.ImageMixDeal;
import com.tool.tcp.NewPart;
import com.tool.tcp.SpriteFactory;
import com.tool.tcpimg.RichLabel;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;



/**
 * 召唤兽合成面板 编号:36
 *
 * @author HGC<br>
 * @time 2020年1月10日 下午1:56:01<br>
 * @class 类名:SummoningCompoundJpanel<br>
 */
public class SummoningCompoundJpanel extends JPanel {

    /**
     * 字段名:labOne 第一个框<br>
     * 字段名:labTwo 第二个框<br>
     *
     * @time 2020年1月10日 下午2:09:54<br>
     */
    private JLabel labOne, labTwo;

    /**
     * 字段名:scpSummoningList 可合成召唤兽名单<br>
     * 字段名:scpSummoningInitialValue 初值属性<br>
     * 字段名:scpSummoningEndValue 天生技能<br>
     */
    private JScrollPane scpSummoningList, scpSummoningInitialValue, scpSummoningEndValue;
    private JTree jTreeSummoningList; // 套装列表
    private DefaultMutableTreeNode nodeSummoningList; // 总节点
    /**
     * 字段名:richInitialValue 初始属性<br>
     * 字段名:richEndValue 天生技能<br>
     */
    private RichLabel richInitialValue, richEndValue, richOneNum, richTwoNum;
    private BigDecimal money;
    private List<Goodstable> goodsList;

    /**
     * 字段名:petExchange 选中的召唤兽<br>
     */
    private petExchange petExchange;

    private SummoningCompoundBtn btnCompound;

    private MLintener mlrOne, mlrTwo;

    public SummoningCompoundJpanel() {
    		setPreferredSize(new Dimension(525, 408));
            setOpaque(false);
            setLayout(null);

            // 关闭按钮事件
        if (MyIsif.getStyle().equals("水墨UI")) {
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 36);
            offBtn.setBounds(525 - 37, 10, 25, 25);
            this.add(offBtn);
        }else {
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/hongmu/1/S74.png", 1, 36);
            offBtn.setBounds(500, 0, 25, 25);
            this.add(offBtn);
        }
            getRichTwoNum();
            getRichOneNum();
            getLabOne();
            getLabTwo();
            getScpSummoningList();
            getScpSummoningEndValue();
            getScpSummoningInitialValue();
            getBtnCompound();
    }

    /** 初始化召唤兽 */
    public void reSummoningList(Map<Integer, petExchange> map) {

        nodeSummoningList.removeAllChildren();
        // ConcurrentHashMap<Integer, petExchange> allPetExchange = new
        // ConcurrentHashMap<>();
        // if (map == null) {
        // map = new HashMap<Integer, petExchange>();
        // for (int i = 0; i < 100; i++) {
        // petExchange exchange = new petExchange();
        // exchange.seteId(i + 1);
        // exchange.setType(i % 4 == 0 ? "基本召唤兽" : (i % 3 == 0 ? "高级召唤兽" : (i %
        // 2 == 0 ? "顶级召唤兽" : "圣兽")));
        // exchange.setName("召唤兽" + i);
        // exchange.setHp(i * 5);
        // exchange.setMp(i * 2);
        // exchange.setSp(i * 3);
        // exchange.setGrow(0.2 * i);
        // exchange.setConsume("D=" + (1000 * i) + "|G=7050=" + (i * 3) + (i % 2
        // == 0 ? ("|G=101=" + i * 2) : ""));
        // exchange.setAp(i * 4);
        // exchange.setFive("金:" + (i * 2) + "木:" + (i * 5) + "水:" + (i * 8) +
        // "火:" + (i * 23) + "土:" + (i * 24));
        // exchange.setSkill("1075|1065|1005|1064");
        // map.put(exchange.geteId(), exchange);
        // allPetExchange.put(exchange.geteId(), exchange);
        // }
        // }
        // UserMessUntil.getAllPetExchange().setAllPetExchange(allPetExchange);
        List<petExchange> mapList = new ArrayList<>();
        Set<Entry<Integer, petExchange>> entrySet = map.entrySet();
        S: for (Entry<Integer, petExchange> entry : entrySet) {
            petExchange petExchange = entry.getValue();
            for (int i = 0; i < mapList.size(); i++) {
                if (mapList.get(i).geteId() > petExchange.geteId()) {
                    mapList.add(i, petExchange);
                    continue S;
                }
            }
            mapList.add(petExchange);
        }

        S: for (int i = 0; i < mapList.size(); i++) {
            petExchange petExchange = mapList.get(i);
            int childCount = nodeSummoningList.getChildCount();
            for (int j = 0; j < childCount; j++) {
                DefaultMutableTreeNode childAt = (DefaultMutableTreeNode) nodeSummoningList.getChildAt(j);
                if (petExchange.getType().equals(childAt.toString())) {
                    DefaultMutableTreeNode defaultMutableTreeNode = new DefaultMutableTreeNode(new JTreeData(
                            petExchange.getName(), String.valueOf(petExchange.geteId())));
                    childAt.add(defaultMutableTreeNode);
                    continue S;
                }
            }
            DefaultMutableTreeNode defaultMutableTreeNode = new DefaultMutableTreeNode(petExchange.getType());
            defaultMutableTreeNode.add(new DefaultMutableTreeNode(new JTreeData(petExchange.getName(), String
                    .valueOf(petExchange.geteId()))));
            nodeSummoningList.add(defaultMutableTreeNode);
        }
    }

    /** 展示初始数据 */
    public void ShowInitialValue(petExchange exchange) {

        StringBuffer buffer = new StringBuffer();
        if (exchange != null) {
            buffer.append("成长率:");
            buffer.append(exchange.getGrow());
            buffer.append("#r");
            buffer.append("血初值:");
            buffer.append(exchange.getHp());
            buffer.append("#r");
            buffer.append("法初值:");
            buffer.append(exchange.getMp());
            buffer.append("#r");
            buffer.append("功初值:");
            buffer.append(exchange.getAp());
            buffer.append("#r");
            buffer.append("敏初值:");
            buffer.append(exchange.getSp());
            buffer.append("#r");
            buffer.append("五行:");
            buffer.append(exchange.getFive());
            buffer.append("#r");
        }
        richInitialValue.setText(buffer.toString());
        Dimension d = richInitialValue.computeSize(123);
        richInitialValue.setSize(d);
        richInitialValue.setPreferredSize(d);
    }

    /** 展示天生技能 */
    public void ShowEndValue(petExchange exchange) {
        StringBuffer buffer = new StringBuffer();
        if (exchange != null) {
            String skill = exchange.getSkill();
            if (skill != null && !"".equals(skill)) {

                String[] split = skill.split("\\|");
                for (int i = 0; i < split.length; i++) {
                    Skill skillOne = UserMessUntil.getSkillId(split[i]);
                    buffer.append(skillOne.getSkillname());
                    buffer.append("#r");
                    richEndValue.setText(buffer.toString());
                    Dimension d = richEndValue.computeSize(123);
                    richEndValue.setSize(d);
                    richEndValue.setPreferredSize(d);
                }
                return;
            }
        }
        richEndValue.setText(buffer.toString());
        Dimension d = richEndValue.computeSize(123);
        richEndValue.setSize(d);
        richEndValue.setPreferredSize(d);

    }

    /** 展示消耗物品金钱 */
    public void ShowConsume(petExchange exchange) {
        // D=消耗金钱|G=物品id=数量|G=物品id=数量
        clearConsume();
        if (exchange != null) {
            String consume = exchange.getConsume();
            if (consume != null && !"".equals(consume)) {
                String[] split = consume.split("\\|");
                int num = 0;
                for (int i = 0; i < split.length; i++) {
                    if (split[i].startsWith("D")) {
                        String[] arrMoney = split[i].split("=");
                        money = new BigDecimal(arrMoney[1]);
                    } else if (split[i].startsWith("G")) {
                        String[] arrMoney = split[i].split("=");
                        Goodstable goodstable = UserMessUntil.getgoodstable(new BigDecimal(arrMoney[1]));
                        int needMum = Integer.parseInt(arrMoney[2]);
                        if (num == 0) {
                            labOne.setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 49, 49));
                            mlrOne.setGrid(goodstable.getGoodsid());
                            mlrOne.setNeedNum(needMum);
                            int goodNum = GoodsListFromServerUntil.getGoodNum(goodstable.getGoodsid());
                            if (needMum > goodNum) {
                                richOneNum.setText("#R" + goodNum + "#c228B22/" + needMum);
                            } else {
                                richOneNum.setText("#c228B22" + goodNum + "/" + needMum);
                            }
                        } else if (num == 1) {
                            labTwo.setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 49, 49));
                            int goodNum = GoodsListFromServerUntil.getGoodNum(goodstable.getGoodsid());
                            mlrTwo.setGrid(goodstable.getGoodsid());
                            mlrTwo.setNeedNum(needMum);
                            if (needMum > goodNum) {
                                richTwoNum.setText("#R" + goodNum + "#c228B22/" + needMum);
                            } else {
                                richTwoNum.setText("#c228B22" + goodNum + "/" + needMum);
                            }
                        }
                        num++;
                    }
                }
            }
        }
    }

    /** 清空消耗物品金额 */
    public void clearConsume() {
        labOne.setIcon(null);
        labTwo.setIcon(null);
        richOneNum.setText("");
        richTwoNum.setText("");
        mlrTwo.setGrid(null);
        mlrTwo.setNeedNum(0);
        mlrOne.setGrid(null);
        mlrOne.setNeedNum(0);
        money = null;
    }

    /** 物品移入移出监听 */
    class MLintener implements MouseListener {

        private BigDecimal grid;
        private int needNum;

        public MLintener(BigDecimal grid) {
            this.grid = grid;
        }

        @Override
        public void mouseClicked(MouseEvent e) {
            // TODO Auto-generated method stub

        }

        @Override
        public void mousePressed(MouseEvent e) {
            // TODO Auto-generated method stub

        }

        @Override
        public void mouseReleased(MouseEvent e) {
            // TODO Auto-generated method stub

        }

        @Override
        public void mouseEntered(MouseEvent e) {
            MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE12);
            // TODO Auto-generated method stub
            Goodstable goodstable = UserMessUntil.getgoodstable(grid);
            if (goodstable != null) {
                ZhuFrame.getZhuJpanel().creatgoodtext(goodstable);
            }
        }

        @Override
        public void mouseExited(MouseEvent e) {
            MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
            TestpackJframe.getTestpackJframe().getJpac().ClearText();
            ZhuFrame.getZhuJpanel().cleargoodtext();
        }

        public BigDecimal getGrid() {
            return grid;
        }

        public void setGrid(BigDecimal grid) {
            this.grid = grid;
        }

        public int getNeedNum() {
            return needNum;
        }

        public void setNeedNum(int needNum) {
            this.needNum = needNum;
        }

    }

    private ImageIcon icon;
    private NewPart part;//
    private int oneNum, twoNum, num;

    @Override
    protected void paintComponent(Graphics g) {
        // TODO Auto-generated method stub
        super.paintComponent(g);
         if (MyIsif.getStyle().equals("水墨UI")) {
        	if (icon == null) {
                icon = new ImageIcon("inkImg/newbackground/B295.png");
            }
            g.drawImage(icon.getImage(), 0, 0, 525, 408, null);
            Util.drawMoney(g, 396, 184);
            if (money != null) {
                Util.drawPrice(g, money, 396, 150);
            }
            if (part != null) {
                part.draw(g, 300, 201, 0, ImageMixDeal.userimg.getTime());
            }

            if (num > 100) {
                num = 0;
                if (mlrOne.getGrid() != null) {
                    int goodNum = GoodsListFromServerUntil.getGoodNum(mlrOne.getGrid());
                    if (goodNum != oneNum) {
                        oneNum = goodNum;
                        int needNum = mlrOne.getNeedNum();
                        if (needNum > goodNum) {
                            richOneNum.setText("#R" + goodNum + "#c228B22/" + needNum);
                        } else {
                            richOneNum.setText("#c228B22" + goodNum + "/" + needNum);
                        }
                    }
                }
                if (mlrTwo.getGrid() != null) {
                    int goodNum = GoodsListFromServerUntil.getGoodNum(mlrTwo.getGrid());
                    if (goodNum != twoNum) {
                        twoNum = goodNum;
                        int needNum = mlrTwo.getNeedNum();
                        if (needNum > goodNum) {
                            richTwoNum.setText("#R" + goodNum + "#c228B22/" + needNum);
                        } else {
                            richTwoNum.setText("#c228B22" + goodNum + "/" + needNum);
                        }
                    }
                }
            }

          }else {
              if (icon == null) {
                   icon = new ImageIcon("inkImg/hongmu/2/S165.png");
                }
                g.drawImage(icon.getImage(), 0, 0, 525, 408, null);
                Util.drawMoney(g, 407, 189);
                if (money != null)
                    Util.drawPrice(g, money, 407, 159);
                if (part != null)
                    part.draw(g, 300, 201, 0, ImageMixDeal.userimg.getTime());

                if (num > 100) {
                    num = 0;
                    if (mlrOne.getGrid() != null) {
                        int goodNum = GoodsListFromServerUntil.getGoodNum(mlrOne.getGrid());
                        if (goodNum != oneNum) {
                            oneNum = goodNum;
                            int needNum = mlrOne.getNeedNum();
                            if (needNum > goodNum) {
                                richOneNum.setText("#R" + goodNum + "#c228B22/" + needNum);
                            } else {
                                richOneNum.setText("#c228B22" + goodNum + "/" + needNum);
                            }
                        }
                    }
                    if (mlrTwo.getGrid() != null) {
                        int goodNum = GoodsListFromServerUntil.getGoodNum(mlrTwo.getGrid());
                        if (goodNum != twoNum) {
                            twoNum = goodNum;
                            int needNum = mlrTwo.getNeedNum();
                            if (needNum > goodNum) {
                                richTwoNum.setText("#R" + goodNum + "#c228B22/" + needNum);
                            } else {
                                richTwoNum.setText("#c228B22" + goodNum + "/" + needNum);
                          }
                    }
                }

             }
        }
        num++;
    }

    public JLabel getLabOne() {
        if (labOne == null) {
            labOne = new JLabel();
            if (MyIsif.getStyle().equals("水墨UI")) {
                labOne.setBounds(363, 70, 50, 50);
            }else {
                labOne.setBounds(375, 70, 50, 50);
            }
            mlrOne = new MLintener(null);
            labOne.addMouseListener(mlrOne);
            this.add(labOne);
        }
        return labOne;
    }

    public void setLabOne(JLabel labOne) {

        this.labOne = labOne;
    }

    public JLabel getLabTwo() {
        if (labTwo == null) {
            labTwo = new JLabel();
            if (MyIsif.getStyle().equals("水墨UI")) {
                labTwo.setBounds(436, 70, 50, 50);
            }else {
                labTwo.setBounds(450, 70, 50, 50);
            }
            mlrTwo = new MLintener(null);
            labTwo.addMouseListener(mlrTwo);
            this.add(labTwo);
        }
        return labTwo;
    }

    public void setLabTwo(JLabel labTwo) {
        this.labTwo = labTwo;
    }

    public JScrollPane getScpSummoningList() {
        if (scpSummoningList == null) {
            // 属性滚动条
            scpSummoningList = new JScrollPane(getjTreeSummoningList());
            scpSummoningList.setVerticalScrollBarPolicy(22);
            scpSummoningList.getVerticalScrollBar().setUI(new ScrollUI());
            scpSummoningList.getVerticalScrollBar().setUnitIncrement(20);
            scpSummoningList.getViewport().setOpaque(false);
            scpSummoningList.setOpaque(false);
            if (MyIsif.getStyle().equals("水墨UI")) {
                scpSummoningList.setBounds(47, 52, 161 + 3, 333);
            }else {
                scpSummoningList.setBounds(38, 75, 161, 310);
            }
            scpSummoningList.setBorder(BorderFactory.createEmptyBorder());
            scpSummoningList.setHorizontalScrollBarPolicy(31);
            this.add(scpSummoningList);
        }
        return scpSummoningList;
    }

    public void setScpSummoningList(JScrollPane scpSummoningList) {
        this.scpSummoningList = scpSummoningList;
    }

    public JScrollPane getScpSummoningInitialValue() {
        if (scpSummoningInitialValue == null) {
            // 属性滚动条
            scpSummoningInitialValue = new JScrollPane(getRichInitialValue());
            scpSummoningInitialValue.setVerticalScrollBarPolicy(22);
            scpSummoningInitialValue.getVerticalScrollBar().setUI(new ScrollUI());
            scpSummoningInitialValue.getVerticalScrollBar().setUnitIncrement(20);
            scpSummoningInitialValue.getViewport().setOpaque(false);
            scpSummoningInitialValue.setOpaque(false);
            if (MyIsif.getStyle().equals("水墨UI")) {
                scpSummoningInitialValue.setBounds(219, 267, 138, 119);
            }else {
                scpSummoningInitialValue.setBounds(221, 265, 126, 116);
            }
            scpSummoningInitialValue.setBorder(BorderFactory.createEmptyBorder());
            scpSummoningInitialValue.setHorizontalScrollBarPolicy(31);
            this.add(scpSummoningInitialValue);
        }
        return scpSummoningInitialValue;
    }

    public void setScpSummoningInitialValue(JScrollPane scpSummoningInitialValue) {
        this.scpSummoningInitialValue = scpSummoningInitialValue;
    }

    public JScrollPane getScpSummoningEndValue() {
        if (scpSummoningEndValue == null) {
            // 属性滚动条
            scpSummoningEndValue = new JScrollPane(getRichEndValue());
            scpSummoningEndValue.setVerticalScrollBarPolicy(22);
            scpSummoningEndValue.getVerticalScrollBar().setUI(new ScrollUI());
            scpSummoningEndValue.getVerticalScrollBar().setUnitIncrement(20);
            scpSummoningEndValue.getViewport().setOpaque(false);
            scpSummoningEndValue.setOpaque(false);
            if (MyIsif.getStyle().equals("水墨UI")) {
                scpSummoningEndValue.setBounds(364, 267, 138, 119);
            }else {
                scpSummoningEndValue.setBounds(372, 265, 128, 118);
            }
            scpSummoningEndValue.setBorder(BorderFactory.createEmptyBorder());
            scpSummoningEndValue.setHorizontalScrollBarPolicy(31);
            this.add(scpSummoningEndValue);
        }
        return scpSummoningEndValue;
    }

    public void setScpSummoningEndValue(JScrollPane scpSummoningEndValue) {
        this.scpSummoningEndValue = scpSummoningEndValue;
    }

    public ImageIcon getIcon() {
        return icon;
    }

    public void setIcon(ImageIcon icon) {
        this.icon = icon;
    }

    public JTree getjTreeSummoningList() {
        if (jTreeSummoningList == null) {
            jTreeSummoningList = new JTree(getNodeSummoningList());
            jTreeSummoningList.setOpaque(false);
            jTreeSummoningList.putClientProperty("JTree.lineStyle", "None"); // 去除jtree的线条
            ((BasicTreeUI) jTreeSummoningList.getUI()).setLeftChildIndent(0); // 设置父节点与子节点左对齐，并去除缩进
            DefaultTreeCellRenderer cellRenderer = new DefaultTreeCellRenderer() {
                @Override
                public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
                                                              boolean expanded, boolean leaf, int row, boolean hasFocus) {
                    DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
                    super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);

                    // 判断是几级的叶子
                    if (node.getLevel() == 2) {
                        JTreeData jtd = (JTreeData) node.getUserObject();
                        setText(jtd.getString());
                    }
                    return this;
                }
            };
            cellRenderer.setLeafIcon(null); // 设置叶子图标
            try {
                cellRenderer.setOpenIcon(CutButtonImage.cuts("skin/8100226/button/B108.png")[0]); // 设置打开子节点图标
                cellRenderer.setClosedIcon(CutButtonImage.cuts("skin/8100226/button/B109.png")[0]); // 置关闭子节点图标
            } catch (Exception e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }

            cellRenderer.setFont(UIUtils.TEXT_FONT1);// 设置字体.
            cellRenderer.setBackgroundNonSelectionColor(UIUtils.Color_BACK);// 设置非选定节点的背景色
            cellRenderer.setBackgroundSelectionColor(new Color(99, 93, 90));// 设置节点在选中状态下的背景色
            cellRenderer.setBorderSelectionColor(UIUtils.Color_BACK);// 设置选中状态下节点边框的颜色

            /*
             * 设置选时或不选时，文字的变化颜色
             */
            cellRenderer.setTextNonSelectionColor(Color.white);// 设置绘制未选中状态下节点文本的颜色
            cellRenderer.setTextSelectionColor(Color.white);// 设置绘制选中状态下节点文本的颜色
            jTreeSummoningList.setCellRenderer(cellRenderer);
            jTreeSummoningList.setRootVisible(false); // 隐藏根节点
            jTreeSummoningList.setRowHeight(20); // 设置节点行高
            // 单击展开子节点
            jTreeSummoningList.addMouseListener(new MouseAdapter() { // 添加鼠标事件处理
                @Override
                public void mousePressed(MouseEvent e) {
                    if (SwingUtilities.isLeftMouseButton(e)) { // 点击了鼠标左键
                        TreePath path = jTreeSummoningList.getSelectionPath();
                        if (path != null) {
                            if (jTreeSummoningList.isExpanded(path)) {
                                jTreeSummoningList.collapsePath(path);// 关闭节点
                            } else {
                                jTreeSummoningList.expandPath(path);// 展开节点
                            }
                        }
                    }
                }
            });
            jTreeSummoningList.addTreeSelectionListener(new TreeSelectionListener() {

                @Override
                public void valueChanged(TreeSelectionEvent e) {

                    JTree tree = (JTree) e.getSource();
                    // 利用JTree的getLastSelectedPathComponent()方法取得目前选取的节点.
                    DefaultMutableTreeNode selectionNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
                    if (selectionNode == null) {
                        scpSummoningList.setViewportView(null);
                        return;
                    }
                    String nodeName = selectionNode.toString();
                    if (selectionNode.isLeaf()) {// 判断是否是叶子节点
                        JTreeData treeData = (JTreeData) selectionNode.getUserObject();
                        int parseInt = Integer.parseInt(treeData.getPath());
                        petExchange exchange = UserMessUntil.getPetExchange(parseInt);
                        petExchange = exchange;
                        part = SpriteFactory.createPart(exchange.getSkin(), 5, 1, null);
                        ShowInitialValue(exchange);
                        ShowEndValue(exchange);
                        ShowConsume(exchange);
                    } else {
                    }
                }
            });
        }
        return jTreeSummoningList;
    }

    public void setjTreeSummoningList(JTree jTreeSummoningList) {
        this.jTreeSummoningList = jTreeSummoningList;
    }

    public DefaultMutableTreeNode getNodeSummoningList() {
        if (nodeSummoningList == null) {
            nodeSummoningList = new DefaultMutableTreeNode("");
            reSummoningList(UserMessUntil.getAllPetExchange().getAllPetExchange());
        }
        return nodeSummoningList;
    }

    public void setNodeSummoningList(DefaultMutableTreeNode nodeSummoningList) {
        this.nodeSummoningList = nodeSummoningList;
    }

    public RichLabel getRichInitialValue() {
        if (richInitialValue == null) {
            richInitialValue = new RichLabel();
        }
        return richInitialValue;
    }

    public void setRichInitialValue(RichLabel richInitialValue) {
        this.richInitialValue = richInitialValue;
    }

    public RichLabel getRichEndValue() {
        if (richEndValue == null) {
            richEndValue = new RichLabel();
        }
        return richEndValue;
    }

    public void setRichEndValue(RichLabel richEndValue) {
        this.richEndValue = richEndValue;
    }

    public RichLabel getRichOneNum() {
        if (richOneNum == null) {
            richOneNum = new RichLabel();
            if (MyIsif.getStyle().equals("水墨UI")) {
                richOneNum.setBounds(368, 118, 50, 16);
            }else {
                richOneNum.setBounds(370, 120, 50, 16);
            }
            this.add(richOneNum);
        }
        return richOneNum;
    }

    public void setRichOneNum(RichLabel richOneNum) {
        this.richOneNum = richOneNum;
    }

    public RichLabel getRichTwoNum() {
        if (richTwoNum == null) {
            richTwoNum = new RichLabel();
            if (MyIsif.getStyle().equals("水墨UI")) {
                richTwoNum.setBounds(441, 118, 50, 16);
            }else {
                richTwoNum.setBounds(443, 120, 50, 16);
            }
            this.add(richTwoNum);
        }
        return richTwoNum;
    }

    public void setRichTwoNum(RichLabel richTwoNum) {
        this.richTwoNum = richTwoNum;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public List<Goodstable> getGoodsList() {
        return goodsList;
    }

    public void setGoodsList(List<Goodstable> goodsList) {
        this.goodsList = goodsList;
    }

    public NewPart getPart() {
        return part;
    }

    public void setPart(NewPart part) {
        this.part = part;
    }

    public petExchange getPetExchange() {
        return petExchange;
    }

    public void setPetExchange(petExchange petExchange) {
        this.petExchange = petExchange;
    }

    public SummoningCompoundBtn getBtnCompound() {
        if (MyIsif.getStyle().equals("水墨UI")) {
    		if (btnCompound == null) {
                btnCompound = new SummoningCompoundBtn("skin/8100226/newbutton/B20.png", 1, UIUtils.COLOR_BTNPUTONG, "合成",
                        UIUtils.TEXT_HY16, 1, this);
                btnCompound.setBounds(392, 198, 59, 24);
                this.add(btnCompound);
                }
            }else {
                if (btnCompound == null) {
                    btnCompound = new SummoningCompoundBtn("inkImg/hongmu/1/6026.png", 1, UIUtils.COLOR_YELLOW1, "合成",
                            UIUtils.TEXT_HY88, 1, this);
                    btnCompound.setBounds(420, 210, 60, 26);
                    this.add(btnCompound);
                }
            }
        return btnCompound;
    }

    public void setBtnCompound(SummoningCompoundBtn btnCompound) {
        this.btnCompound = btnCompound;
    }

}
